import http from '@/api/request'
import type { Receiver,OaGroup,OaGroupMember} from '@/types/workflow'

 

/**
 *  校领导
 */
export const getLeaderGroups =  async ()=>{
    const result =  await http.get<OaGroup[]>('/group/leaders')
    return result;
}
 

export const getInitReceiverList = async ()=>{
    const result =  await http.get<Receiver[]>('/group/getInitReceiverList')
    return result;
}

export const getReceiverListByParent = async (parentReceiver:Receiver)=>{
    const result = await http.get<Receiver[]>('/group/getReceiverListByParent',{
        ...parentReceiver
    });
    return result.data;
}

export const searchReceiver = async (keyword:string)=>{
    const result =  await http.get<Receiver[]>('/group/searchReceiver',{
        keyword
    });
    return result.data;
}

export const getNotifyLeaders = async ()=>{
    const result =  await http.get<OaGroupMember[]>('/group/getNotifyLeaders');
    return result.data;
}